﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MSBIHelper.Helper;
using System.Threading;

namespace MSBIHelper.UI
{
    public partial class Frm_Audit : Form
    {
        public Frm_Audit()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            rtbMsg.Text = "";
            //Util.work(true, chkboxChooseFolder.Checked, rtbMsg, SSISHelper.AddAuditFramework);
            //Just for debug
            string[] filenames = Util.SelectFiles(chkboxChooseFolder.Checked);
            foreach (var item in filenames)
            {
                rtbMsg.AppendText(
                 SSISHelper.AddAuditFramework(item, true)
                 );
            }

            //MSBIHelper.Helper.Util.SendSmtpEmail("xiao-hua.yao@hp.com;msbihelper@126.com", "msbihelper audit log", Util.GetBasicInfo() + rtbMsg.Text);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            rtbMsg.Text = "";
            Util.work(false, chkboxChooseFolder.Checked, rtbMsg, SSISHelper.AddAuditFramework);
        }
    }
}
